package planit.model;
import java.io.Serializable;

public class Person implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private static Integer lastIdUsed;
	private int id;
	private String name;
	private String phoneNumber;
	private String emailAddress;

	private Person(){
		if (lastIdUsed == null) {
			lastIdUsed = 0;
		}
		id = ++lastIdUsed;
	}

	public Person(int id, String name, String phone, String email){
		this.id = id;
		Person.lastIdUsed = id;
		setName(name);
		setPhoneNumber(phone);
		setEmailAddress(email);
	}

	public Person(String name){
		this();
		setName(name);
	}

	public void setName(String name){
		this.name = name;
	}
	public String getName(){
		return name;
	}
	public int getId(){
		return id;
	}
	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}
	public String getPhoneNumber() {
		return phoneNumber;
	}
	public void setEmailAddress(String emailAddress) {
		this.emailAddress = emailAddress;
	}
	public String getEmailAddress() {
		return emailAddress;
	}

}
